/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
// panimwin.hpp - Peg Animation Window class definition.
//
// Author: Kenneth G. Maxwell
//
// Copyright (c) 1997-2000 Swell Software
//              All Rights Reserved.
//
// Unauthorized redistrition of this source code, in whole or part,
// without the express written permission of Swell Software
// is strictly prohibited.
//
// Notes:
//
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/

#ifndef _ANIMWIN_
#define _ANIMWIN_

/*--------------------------------------------------------------------------*/
class PegAnimationWindow : public PegWindow
{
    public:
        PegAnimationWindow(const PegRect &Rect, PEGINT BkgBmp,
                           PEGINT *FrameList, PEGUBYTE NumFrames,
                           PEGINT xPos, PEGINT yPos, PEGUBYTE *Palette = NULL,
                           PEGULONG Style = FF_NONE);

        virtual void Draw(const PegRect &Invalid);
        virtual PEGINT Message(const PegMessage &Mesg);
        virtual void Run(PEGUINT Period, PEGUBYTE Frame = 0);

        virtual void SetAnimationList(PEGINT *pList)
        {
            mpAnimations = pList;
        }
        virtual void SetBkgBitmap(PEGINT BkgBmp) {mBkgBmp = BkgBmp;}
        virtual void SetFrame(PEGUBYTE Frame = 0);
        virtual void SetFrameOffset(PEGINT xOffset, PEGINT yOffset)
        {
            mFramePoint.x = (PEGSHORT) xOffset;
            mFramePoint.y = (PEGSHORT) yOffset;
        }
        virtual void Stop(void);

    protected:
        virtual void DrawAnimationFrame(void);

        PegPoint mFramePoint;
        PEGUBYTE *mpPalette;
        PEGINT mBkgBmp;
        PEGINT *mpAnimations;
        PEGUBYTE mAnimationFrame;
        PEGUBYTE mNumFrames;

    private:

};


#endif

